Efedotov/2025 03 01 terraform azure rm for adbs cross region disaster recovery#30167
Conversation
catriona-m
left a comment
There was a problem hiding this comment.
Hi @evgeniifedotov - it looks like there are some build failures on this, if those could be fixed up, then I can take another look. Thanks!
catriona-m
left a comment
There was a problem hiding this comment.
Thanks @evgeniifedotov - could you take a look at resolving the conflicts on this pr? Then we can give this a proper review. Thanks!
ca3ab38 to
695f4b9
Compare
|
@catriona-m The conflicts have been resolved. Could you please comment? Thank you. |
695f4b9 to
1ef44e2
Compare
|
@ms-henglu please help review this PR. |
ms-henglu
left a comment
There was a problem hiding this comment.
Thanks for the PR, I left some comments, please check.
| } | ||
|
|
||
| func (AutonomousDatabaseCrossRegionDisasterRecoveryResource) ModelObject() interface{} { | ||
| return &AutonomousDatabaseCrossRegionDisasterRecoveryResource{} |
There was a problem hiding this comment.
It should return "&AutonomousDatabaseCrossRegionDisasterRecoveryResourceModel{}"
Typed resources must return the model struct; returning the resource struct will break decode/encode.
|
|
||
| var model AutonomousDatabaseCrossRegionDisasterRecoveryResourceModel | ||
| if err := metadata.Decode(&model); err != nil { | ||
| return err |
There was a problem hiding this comment.
Wrap decode error instead of returning raw:
return fmt.Errorf("decoding: %+v", err)
|
|
||
| var model AutonomousDatabaseCrossRegionDisasterRecoveryResourceModel | ||
| if err = metadata.Decode(&model); err != nil { | ||
| return fmt.Errorf("decoding err: %+v", err) |
There was a problem hiding this comment.
return fmt.Errorf("decoding: %+v", err)
|
|
||
| err = client.UpdateThenPoll(ctx, *id, *update) | ||
| if err != nil { | ||
| return fmt.Errorf("updating %s: %v", id, err) |
There was a problem hiding this comment.
use %+v not %v:
return fmt.Errorf("updating %s: %+v", id, err)
| Func: func(ctx context.Context, metadata sdk.ResourceMetaData) error { | ||
| id, err := autonomousdatabases.ParseAutonomousDatabaseID(metadata.ResourceData.Id()) | ||
| if err != nil { | ||
| return fmt.Errorf("retrieving %s: %+v", id, err) |
There was a problem hiding this comment.
avoid referencing id when parsing fails; include the raw ID instead:
return fmt.Errorf("parsing %q: %+v", metadata.ResourceData.Id(), err)
| --- | ||
| subcategory: "Oracle" | ||
| layout: "azurerm" | ||
| page_title: "Azure Resource Manager: Data Source: azurerm_oracle_autonomous_database" |
There was a problem hiding this comment.
The title should be "azurerm_oracle_autonomous_database_cross_region_disaster_recovery"
| layout: "azurerm" | ||
| page_title: "Azure Resource Manager: Data Source: azurerm_oracle_autonomous_database" | ||
| description: |- | ||
| Gets information about an existing Autonomous Database. |
There was a problem hiding this comment.
The description should be "Gets information about an existing Cross Region Disaster Recovery Autonomous Database."
| source_id = azurerm_oracle_autonomous_database_cross_region_disaster_recovery.adbs_secondary_crdr.source_id | ||
| source_ocid = azurerm_oracle_autonomous_database_cross_region_disaster_recovery.adbs_secondary_crdr.source_ocid | ||
| remote_disaster_recovery_type = azurerm_oracle_autonomous_database_cross_region_disaster_recovery.adbs_secondary_crdr.remote_disaster_recovery_type | ||
| replicate_automatic_backups_enabled = azurerm_oracle_autonomous_database_cross_region_disaster_recovery.adbs_secondary_crdr.replicate_automatic_backups |
There was a problem hiding this comment.
I think it shoud be:
replicate_automatic_backups_enabled = azurerm_oracle_autonomous_database_cross_region_disaster_recovery.adbs_secondary_crdr.replicate_automatic_backups_enabled
| ## Example Usage | ||
|
|
||
| ```hcl | ||
| resource "azurerm_oracle_autonomous_database_cross_region_disaster_recovery" "adbs_secondary_crdr" { |
There was a problem hiding this comment.
Would you please use a complete example here instead of using the placeholders.
| Type: pluginsdk.TypeBool, | ||
| Computed: true, | ||
| }, | ||
| "database_type": { |
There was a problem hiding this comment.
I think we don't need to expose all the readonly fields, maybe just the fields that could be referenced by other resources.
91842ea to
17062ad
Compare
|
@ms-henglu I have addressed the latest comments . Could you please check? |
| func (AutonomousDatabaseRegularResource) Attributes() map[string]*pluginsdk.Schema { | ||
| return map[string]*pluginsdk.Schema{} | ||
| return map[string]*pluginsdk.Schema{ | ||
| "ocid": { |
There was a problem hiding this comment.
Please also update this change in the document.
There was a problem hiding this comment.
This is not resolved yet
There was a problem hiding this comment.
This comment is still not resolved, the documentation for azurerm_oracle_autonomous_database doesn't include this attribute
There was a problem hiding this comment.
removed this attribute as its not needed to be in the resource file .
| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validate.AdbsComputeModel, |
There was a problem hiding this comment.
For properties which have a set of allowed values, please update the validate func like below:
ValidateFunc: validation.StringInSlice(autonomousdatabases.PossibleValuesForComputeModel(), false),| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validation.StringInSlice([]string{ |
There was a problem hiding this comment.
Please update this to
ValidateFunc: validation.StringInSlice(autonomousdatabases.PossibleValuesForWorkloadType(), false),
But I also noticed that PossibleValuesForWorkloadType contain "AJD" and "APEX", can these values be used here?
| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validation.StringInSlice([]string{ |
There was a problem hiding this comment.
Same here.
ValidateFunc: validation.StringInSlice(autonomousdatabases.PossibleValuesForLicenseModel(), false),
| r := AdbsCrossRegionDisasterRecoveryResource{} | ||
| data.ResourceTest(t, r, []acceptance.TestStep{ | ||
| { | ||
| Config: r.requiresImport(data), |
There was a problem hiding this comment.
For the import testcase, the first step should use the basic configuration to set up the resource.
| Type: pluginsdk.TypeString, | ||
| Required: true, | ||
| ForceNew: true, | ||
| ValidateFunc: validate.DatabaseType, |
There was a problem hiding this comment.
Please use
ValidateFunc: validation.StringInSlice(autonomousdatabases.PossibleValuesForDataBaseType(), false),
| "github.com/hashicorp/go-azure-sdk/resource-manager/oracledatabase/2025-03-01/autonomousdatabases" | ||
| ) | ||
|
|
||
| func DbSource(i interface{}, k string) (warnings []string, errors []error) { |
There was a problem hiding this comment.
Please remove this file as these validate functions are not used.
| ## Example Usage | ||
|
|
||
| ```hcl | ||
| resource "azurerm_oracle_autonomous_database_cross_region_disaster_recovery" "example" { |
There was a problem hiding this comment.
Please add a complete configuration as an example.
There was a problem hiding this comment.
Still needs complete example, resource dependencies such as the resource group, virtual network, etc. must be added.
|
|
||
| * `location` - (Required) The Azure Region where the Cross Region Disaster Recovery Autonomous Database should exist. Azure Region must be different from region where your original Autonomous Database resides. Changing this forces a new Cross Region Disaster Recovery Autonomous Database to be created. | ||
|
|
||
| * `database_type` - (Required) The type of Autonomous Database. To create Cross Region Disaster Recovery Autonomous Database set this value to "CrossRegionDisasterRecovery". |
There was a problem hiding this comment.
For the properties that are marked as "ForceNew". Please add "Changing this forces a new resource to be created." to the description.
Please also check:
name
database_type
source
remote_disaster_recovery_type
admin_password
backup_retention_period_in_days
character_set
compute_model
db_version
db_workload
display_name
mtls_connection_required
license_model
national_character_set
subnet_id
virtual_network_id
customer_contacts
|
@ms-henglu can you please check this PR. |
|
@catriona-m I see @ms-henglu has approved it , could you also please review the PR. Thank you. |
There was a problem hiding this comment.
Hi @evgeniifedotov, this will need a bit of work before it can be merged into the provider.
Could you first review my comment in website/docs/r/oracle_autonomous_database_cross_region_disaster_recovery.html.markdown regarding the design of this resource? (here)
| @@ -0,0 +1,535 @@ | |||
| // Copyright © 2025, Oracle and/or its affiliates. All rights reserved | |||
There was a problem hiding this comment.
| // Copyright © 2025, Oracle and/or its affiliates. All rights reserved | |
| // Copyright (c) HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 |
| Type: pluginsdk.TypeString, | ||
| Computed: true, | ||
| }, | ||
| "source_id": { |
There was a problem hiding this comment.
Based on the resource test this looks like the id to an autonomous database, can you update this to be more specific as to what it is?
| "source_id": { | |
| "source_autonomous_database_id": { |
| }, | ||
|
|
||
| // AutonomousDatabaseProperties | ||
| "actual_used_data_storage_size_in_tbs": { |
There was a problem hiding this comment.
| "actual_used_data_storage_size_in_tbs": { | |
| "actual_used_data_storage_size_in_tb": { |
| Computed: true, | ||
| }, | ||
|
|
||
| "allocated_storage_size_in_tbs": { |
There was a problem hiding this comment.
| "allocated_storage_size_in_tbs": { | |
| "allocated_storage_size_in_tb": { |
| "autonomous_database_id": { | ||
| Type: pluginsdk.TypeString, | ||
| Computed: true, | ||
| }, |
There was a problem hiding this comment.
Is this not the same as the id attribute for this datasource?
Please see #29633 (comment)
|
|
||
| ## Import | ||
|
|
||
| Cross Region Disaster Recovery Autonomous Database cannot be imported. `admin_password` parameter is required, but this parameter cannot be imported, therefore the entire import procedure cannot be executed. |
There was a problem hiding this comment.
We have many resources that have password properties that aren't returned by the API. Generally users will just have to set ignore_changes on the properties that aren't imported, or we implement custom import logic.
Resources can always be imported.
| ## Update | ||
|
|
||
| Cross Region Disaster Recovery Autonomous Database cannot be updated as is must have exactly same parameters as peered original Autonomous Database. Updating original Autonomous Database will trigger an update for peered Cross Region Disaster Recovery Autonomous Database. |
There was a problem hiding this comment.
This isn't a heading we include in our docs, please remove.
Additionally, "Cross Region Disaster Recovery Autonomous Database cannot be updated as is must have exactly same parameters as peered original Autonomous Database" doesn't make sense since you have added an update function to this resource?
It sounds like this probably shouldn't have an update function?
| NextLongTermBackupTimeStamp string `tfschema:"next_long_term_backup_time_stamp"` | ||
| Ocid string `tfschema:"ocid"` | ||
| OciUrl string `tfschema:"oci_url"` | ||
| PeerDbId string `tfschema:"peer_db_id"` |
There was a problem hiding this comment.
In #29633, it was brought up that peer_db_id is not actually returned, so there's no sense in exposing it?
Pleas remove any other attributes that don't return a value, always return a single value, or always return empty values (e.g. empty arrays as mentioned in the docs for supported_regions_to_clone_to)
| Computed: true, | ||
| }, | ||
|
|
||
| "peer_db_id": { |
There was a problem hiding this comment.
Since this is not returned there's no need to expose it
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
Please add a note as to why this must be optional+computed (ref)
89810c0 to
d9a7f6d
Compare
| // Copyright (c) HashiCorp, Inc. | ||
| // SPDX-License-Identifier: MPL-2.0 |
There was a problem hiding this comment.
| // Copyright (c) HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 | |
| // Copyright IBM Corp. 2014, 2025 | |
| // SPDX-License-Identifier: MPL-2.0 |
| // Copyright (c) HashiCorp, Inc. | ||
| // SPDX-License-Identifier: MPL-2.0 |
There was a problem hiding this comment.
| // Copyright (c) HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 | |
| // Copyright IBM Corp. 2014, 2025 | |
| // SPDX-License-Identifier: MPL-2.0 |
| // Copyright (c) HashiCorp, Inc. | ||
| // SPDX-License-Identifier: MPL-2.0 |
There was a problem hiding this comment.
| // Copyright (c) HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 | |
| // Copyright IBM Corp. 2014, 2025 | |
| // SPDX-License-Identifier: MPL-2.0 |
| // Copyright (c) HashiCorp, Inc. | ||
| // SPDX-License-Identifier: MPL-2.0 |
There was a problem hiding this comment.
| // Copyright (c) HashiCorp, Inc. | |
| // SPDX-License-Identifier: MPL-2.0 | |
| // Copyright IBM Corp. 2014, 2025 | |
| // SPDX-License-Identifier: MPL-2.0 |
| auto_scaling_enabled = false | ||
| auto_scaling_for_storage_enabled = false | ||
| mtls_connection_required = false | ||
| data_storage_size_in_tbs = 1 |
There was a problem hiding this comment.
Can the testcase pass?
| data_storage_size_in_tbs = 1 | |
| data_storage_size_in_tb = 1 |
There was a problem hiding this comment.
@ms-zhenhua in this part the parameter is passed to the oracle_autonomous_database_resource_test.go to create the primary database , in our legacy code that's how its written with an 's' check it here
| * `private_endpoint_url` - The private endpoint for the resource. | ||
|
|
||
| * `private_endpoint_label` - The private endpoint label for the resource. |
There was a problem hiding this comment.
| * `private_endpoint_url` - The private endpoint for the resource. | |
| * `private_endpoint_label` - The private endpoint label for the resource. | |
| * `private_endpoint_label` - The private endpoint label for the resource. | |
| * `private_endpoint_url` - The private endpoint for the resource. |
| if sourceDb.Model == nil { | ||
| return fmt.Errorf("retrieving %s: `Model` was nil", sourceId) | ||
| } | ||
| sourceLocation := sourceDb.Model.Location |
| * `resource_group_name` - (Required) The name of the Resource Group where the resource should exist. Changing this forces a new resource to be created. | ||
|
|
||
| * `name` - (Required) The name for this Cross Region Disaster Recovery Autonomous Database. Changing this forces a new resource to be created. |
There was a problem hiding this comment.
| * `resource_group_name` - (Required) The name of the Resource Group where the resource should exist. Changing this forces a new resource to be created. | |
| * `name` - (Required) The name for this Cross Region Disaster Recovery Autonomous Database. Changing this forces a new resource to be created. | |
| * `name` - (Required) The name for this Cross Region Disaster Recovery Autonomous Database. Changing this forces a new resource to be created. | |
| * `resource_group_name` - (Required) The name of the Resource Group where the resource should exist. Changing this forces a new resource to be created. |
|
|
||
| Use this data source to access information about an existing peered Cross Region Disaster Recovery Autonomous Database. | ||
|
|
||
| ## Example Usage |
There was a problem hiding this comment.
According to the guidance, all name arguments should be example or be prefixed with example-. Please update all name related arguments in the configuration.
| Manages a Cross Region Disaster Recovery Autonomous Database. | ||
| A Cross Region Disaster Recovery Autonomous Database is an Autonomous Database with a specific Cross-Region Disaster Recovery role. It must be an exact copy of the Autonomous Database for which you want to create a Disaster Recovery instance. The Cross Region Disaster Recovery Autonomous Database must reside in a region that is different from the region of the main Autonomous Database. You must create a separate virtual network and subnet in this second region for the Cross Region Disaster Recovery Autonomous Database to be able to communicate with its original database. | ||
|
|
||
| ## Example Usage |
There was a problem hiding this comment.
According to the guidance, all name arguments should be example or be prefixed with example-. Please update all name related arguments in the configuration.
…BS-Cross-Region_Disaster-Recovery
mihretkidane-OCI
left a comment
There was a problem hiding this comment.
@ms-zhenhua thank you , I have replied and addressed your latest comments.
| return fmt.Errorf("retrieving %s: `Model` was nil", sourceId) | ||
| } | ||
| sourceLocation := location.Normalize(sourceDb.Model.Location) | ||
| if location.Normalize(model.Location) == location.Normalize(sourceLocation) { |
There was a problem hiding this comment.
| if location.Normalize(model.Location) == location.Normalize(sourceLocation) { | |
| normalizedLocation = location.Normalize(model.Location) | |
| if normalizedLocation == sourceLocation { |
|
|
||
| param := autonomousdatabases.AutonomousDatabase{ | ||
| Name: pointer.To(model.Name), | ||
| Location: location.Normalize(model.Location), |
There was a problem hiding this comment.
| Location: location.Normalize(model.Location), | |
| Location: normalizedLocation, |
| if err != nil { | ||
| return err | ||
| } | ||
| VnetId := commonids.NewVirtualNetworkID(subnetId.SubscriptionId, subnetId.ResourceGroupName, subnetId.VirtualNetworkName) |
There was a problem hiding this comment.
| VnetId := commonids.NewVirtualNetworkID(subnetId.SubscriptionId, subnetId.ResourceGroupName, subnetId.VirtualNetworkName) | |
| vnetId := commonids.NewVirtualNetworkID(subnetId.SubscriptionId, subnetId.ResourceGroupName, subnetId.VirtualNetworkName) |
| return fmt.Errorf("retrieving %s: %+v", sourceId, err) | ||
| } | ||
| if sourceDb.Model == nil { | ||
| return fmt.Errorf("retrieving %s: `Model` was nil", sourceId) |
There was a problem hiding this comment.
| return fmt.Errorf("retrieving %s: `Model` was nil", sourceId) | |
| return fmt.Errorf("retrieving %s: `model` was nil", sourceId) |
| VnetId := commonids.NewVirtualNetworkID(subnetId.SubscriptionId, subnetId.ResourceGroupName, subnetId.VirtualNetworkName) | ||
|
|
||
| if sourceDb.Model.Properties == nil { | ||
| return fmt.Errorf("retrieving %s: `Properties` was nil", sourceId) |
There was a problem hiding this comment.
| return fmt.Errorf("retrieving %s: `Properties` was nil", sourceId) | |
| return fmt.Errorf("retrieving %s: `properties` was nil", sourceId) |
| } | ||
|
|
||
| resource "azurerm_subnet" "example_subnet" { | ||
| name = "exampleSubnet" |
There was a problem hiding this comment.
| name = "exampleSubnet" | |
| name = "example-subnet" |
|
|
||
|
|
||
| resource "azurerm_oracle_autonomous_database" "primary" { | ||
| name = "examplePrimary" |
There was a problem hiding this comment.
| name = "examplePrimary" | |
| name = "example-primary" |
| } | ||
|
|
||
| resource "azurerm_virtual_network" "dr_vnet" { | ||
| name = "exampleDrVnet" |
There was a problem hiding this comment.
| name = "exampleDrVnet" | |
| name = "example-dr-vnet" |
| } | ||
|
|
||
| resource "azurerm_subnet" "dr_subnet" { | ||
| name = "exampleDrSubnet" |
There was a problem hiding this comment.
| name = "exampleDrSubnet" | |
| name = "example-dr-subnet" |
| } | ||
|
|
||
| resource "azurerm_oracle_autonomous_database_cross_region_disaster_recovery" "dr_example" { | ||
| name = "exampleDr" |
There was a problem hiding this comment.
| name = "exampleDr" | |
| name = "example-dr" |
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
mihretkidane-OCI
left a comment
There was a problem hiding this comment.
@ms-zhenhua I have updated the PR with new test and resolved last comments please take a look. Thanks!
|
@sreallymatt could you please one more review to this PR. Thanks! |
| } | ||
|
|
||
|
|
||
| resource "azurerm_oracle_autonomous_database" "primary" { |
There was a problem hiding this comment.
| } | |
| resource "azurerm_oracle_autonomous_database" "primary" { | |
| } | |
| resource "azurerm_oracle_autonomous_database" "primary" { |
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
| replicate_automatic_backups_enabled = false | ||
|
|
||
| } | ||
| `, a.template(data), data.RandomInteger, "eastus", "westus") |
There was a problem hiding this comment.
Is there any reason that not use data.Locations.Primary but use const strings of "eastus", "westus" as the location?
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
…BS-Cross-Region_Disaster-Recovery
|
@ms-zhenhua can you check the PR , I have updated to use location.primary and location.secondary . I have validated the PR as well see screenshots.
|







Community Note
Description
To support new Oracle resource type Cross Region Disaster Recovery Autonomous Database the following changes have been made to the Oracle provider: added new resource oracle_autonomous_database_cross_region_disaster_recovery_resource and corresponding data source oracle_autonomous_database_cross_region_disaster_recovery_data_source
New resource oracle_autonomous_database_cross_region_disaster_recovery_resource has following required arguments:
name,
display_name,
location,
database_type,
source,
source_id,
source_ocid,
remote_disaster_recovery_type,
replicate_automatic_backups,
subnet_id,
virtual_network_id,
resource_group_name,
source_location,
license_model,
backup_retention_period_in_days,
auto_scaling_enabled,
auto_scaling_for_storage_enabled,
mtls_connection_required,
data_storage_size_in_tbs,
compute_model,
compute_count,
db_workload,
db_version,
admin_password,
character_set,
national_character_set
New data source oracle_autonomous_database_cross_region_disaster_recovery_data_source has following attributes:
The following arguments are supported:
name- (Required) The name of this Autonomous Database.resource_group_name- (Required) The name of the Resource Group where the Autonomous Database exists.Attributes Reference
In addition to the Arguments listed above - the following Attributes are exported:
actual_used_data_storage_size_in_tbs- The current amount of storage in use for user and system data, in terabytes (TB).allocated_storage_size_in_tbs- The amount of storage currently allocated for the database tables and billed for, rounded up. When auto-scaling is not enabled, this value is equal to thedataStorageSizeInTBsvalue. You can compare this value to theactualUsedDataStorageSizeInTBsvalue to determine if a manual shrink operation is appropriate for your allocated storage.auto_scaling_enabled- Indicates if auto scaling is enabled for the Cross Region Disaster Recovery Autonomous Database CPU core count.auto_scaling_for_storage_enabled- Indicates if auto scaling is enabled for the Cross Region Disaster Recovery Autonomous Database storage.backup_retention_period_in_days- Retention period, in days, for backups.character_set- The character set for the Cross Region Disaster Recovery Autonomous Database.compute_count- The compute amount (CPUs) available to the cross region disaster recovery database.compute_model- The compute model of the Cross Region Disaster Recovery Autonomous Database.database_type- The type of this Cross Region Disaster Recovery Autonomous Database.db_workload- The Autonomous Database workload type. The following values are possible:display_name- The user-friendly name for the Cross Region Disaster Recovery Autonomous Database. The name does not have to be unique.id- The Immutable Azure Resource ID of the Cross Region Disaster Recovery Autonomous Database.license_model- The Oracle license model that applies to the Oracle Cross Region Disaster Recovery Autonomous Database.lifecycle_details- Information about the current lifecycle state.local_data_guard_enabled- Indicates whether the Cross Region Disaster Recovery Autonomous Database has local (in-region) Data Guard enabled. Not applicable to cross-region Autonomous Data Guard associations, or to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure.location- The Azure Region where the Cross Region Disaster Recovery Autonomous Database exists.mtls_connection_required- Specifies if the Cross Region Disaster Recovery Autonomous Database requires mTLS connections.name- The name of this Cross Region Disaster Recovery Autonomous Database.national_character_set- The national character set for the Cross Region Disaster Recovery Autonomous Database. The default is AL16UTF16. Allowed values are: AL16UTF16 or UTF8.oci_url- The URL of the resource in the OCI console.ocid- The OCID of the autonomous database.peer_db_ids- The list of Immutable Azure Resource IDs of Autonomous Databases peered with this Cross Region Disaster Recovery Autonomous Database.private_endpoint- The private endpoint for the resource.private_endpoint_ip- The private endpoint Ip address for the resource.private_endpoint_label- The private endpoint label for the resource.remote_data_guard_enabled- Indicates whether the Cross Region Disaster Recovery Autonomous Database has Cross Region Data Guard enabled. Not applicable to Autonomous Databases using dedicated Exadata infrastructure or Exadata Cloud@Customer infrastructure.remote_disaster_recovery_type- Type of recovery. Value can be eitherAdg(Autonomous Data Guard) orBackupBased.replicate_automatic_backups- If true, 7 days worth of backups are replicated across regions for Cross-Region ADB or Backup-Based Disaster Recovery between Primary and Standby. If false, the backups taken on the Primary are not replicated to the Standby database.source- The source of the database. For cross region disaster recovery autonomous database the source is always "CrossRegionDisasterRecovery" as this type of autonomous database can be created only as disaster recovery solution for another autonomous database.source_id- The Immutable Azure Resource ID of autonomous database for which cross region disaster recovery autonomous database was created.source_location- The Azure Region where source autonomous database for which cross region disaster recovery autonomous database is locatedsource_ocid- The OCID of the autonomous database for which cross region disaster recovery autonomous database was created.subnet_id- The OCID of the subnet the resource is associated with.supported_regions_to_clone_to- The list of regions that support the creation Cross Region Disaster Recovery clone. List is always empty as Cross Region Disaster Recovery Autonomous Database cannot be cloned.time_created- The date and time the Autonomous Database was created.time_data_guard_role_changed- The date and time the Autonomous Data Guard role was switched for the Cross Region Disaster Recovery Autonomous Database. For databases that have standbys in both the primary Data Guard region and a remote Data Guard standby region, this is the latest timestamp of either the database using the "primary" role in the primary Data Guard region, or database located in the remote Data Guard standby region.time_maintenance_begin- The date and time when maintenance will begin.time_maintenance_end- The date and time when maintenance will end.virtual_network_id- The ID to an Azure Resource Manager vnet resource.PR Checklist
Changes to existing Resource / Data Source
Testing
Cross Region Disaster Recovery Autonomous Database cannot be imported.
admin_passwordparameter is required, but this parameter cannot be imported, therefore the entire import procedure and 'requiresImport' test method cannot be executed.Cross Region Disaster Recovery Autonomous Database cannot itself be updated as is must have exactly same parameters as peered original Autonomous Database. Updating original Autonomous Database will trigger an update for peered Cross Region Disaster Recovery Autonomous Database, therefore
updatetest cannot be executed.Completetest to create new instance is passingDataSourcetest is passingChange Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
oracle_autonomous_database_cross_region_disaster_recovery_resource- support for the new Oracle Cross Region Disaster Recovery Autonomous Database resourceoracle_autonomous_database_cross_region_disaster_recovery_data_source- support for the new Oracle Cross Region Disaster Recovery Autonomous Database data sourceThis is a (please select all that apply):
Related Issue(s)
Fixes #30166
Note
If this PR changes meaningfully during the course of review please update the title and description as required.